﻿<sap:ActivityDesigner x:Class="Vision.Core.ActivityComponents.IO.Ftp.FtpUploadFileDataDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sa="clr-namespace:System.Activities;assembly=System.Activities"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    Collapsible="True" ExpandState="True">
    <sap:ActivityDesigner.Resources>
        <sapc:ArgumentToExpressionConverter x:Uid="sadv:ArgumentToExpressionConverter_1" x:Key="argumentToExpressionConverter" />

        <DataTemplate x:Key="ExpandedActivityDesignerTemplate">
            <StackPanel>
                <!-- Inputs Header -->
                <TextBlock Text="Input(s):" FontWeight="Bold" Foreground="Navy" Margin="0,0,0,3" />

                <Grid Margin="0,5,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <!-- ModelItem.RemoteFileName -->
                    <TextBlock Grid.Row="1" Grid.Column="0" Text="File name:" VerticalAlignment="Top" />
                    <sapv:ExpressionTextBox Grid.Row="1" Grid.Column="1" x:Name="remoteFileNameBox"
                        MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top"
                        Expression="{Binding Path=ModelItem.RemoteFileName, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"
                        ExpressionType="{Binding Path=ModelItem.RemoteFileName.ArgumentType}"
                        OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
                </Grid>

                <Grid Margin="0,5,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="70" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <!-- ModelItem.FileData -->
                    <TextBlock Grid.Row="1" Grid.Column="0" Text="File data:" VerticalAlignment="Top" />
                    <sapv:ExpressionTextBox Grid.Row="1" Grid.Column="1" x:Name="fileDataBox"
                        MaxLines="1" Margin="7,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Top"
                        Expression="{Binding Path=ModelItem.FileData, Mode=TwoWay, Converter={StaticResource argumentToExpressionConverter}, ConverterParameter=In}"
                        ExpressionType="{Binding Path=ModelItem.FileData.ArgumentType}"
                        OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
                </Grid>
            </StackPanel>
        </DataTemplate>
        <DataTemplate x:Key="CollapsedActivityDesignerTemplate">
            <Label Padding="0,0,0,0" FontStyle="Italic" Foreground="{x:Static SystemColors.GrayTextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center">Double-click to view</Label>
        </DataTemplate>
        <Style x:Uid="Style_1" x:Key="DesignerStyle" TargetType="{x:Type ContentPresenter}">
            <Setter x:Uid="Setter_1" Property="ContentTemplate" Value="{DynamicResource ExpandedActivityDesignerTemplate}" />
            <Style.Triggers>
                <DataTrigger x:Uid="DataTrigger_1" Binding="{Binding Path=ShowExpanded}" Value="false">
                    <Setter x:Uid="Setter_2" Property="ContentTemplate" Value="{DynamicResource CollapsedActivityDesignerTemplate}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </sap:ActivityDesigner.Resources>

    <ContentPresenter x:Uid="ContentPresenter_1" Style="{DynamicResource DesignerStyle}" Content="{Binding}" />
</sap:ActivityDesigner>
